home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / Dictionary.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  5.5 KB  |  188 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dictionary.a
  3. ;
  4. ;    Contains:    Dictionary Manager Interfaces
  5. ;
  6. ;    Version:    Technology:    System 7
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__DICTIONARY__') = 'UNDEFINED' THEN
  18. __DICTIONARY__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  24.     include 'Files.a'
  25.     ENDIF
  26.  
  27.  
  28.  
  29.                                                             ; Dictionary data insertion modes 
  30. kInsert                            EQU        0                    ; Only insert the input entry if there is nothing in the dictionary that matches the key. 
  31. kReplace                        EQU        1                    ; Only replace the entries which match the key with the input entry. 
  32. kInsertOrReplace                EQU        2                    ; Insert the entry if there is nothing in the dictionary which matches the key, otherwise replaces the existing matched entries with the input entry. 
  33. ;  This Was InsertMode 
  34. ; typedef short                         DictionaryDataInsertMode
  35.  
  36.  
  37.                                                             ; Key attribute constants 
  38. kIsCaseSensitive                EQU        $10                    ; case sensitive = 16        
  39. kIsNotDiacriticalSensitive        EQU        $20                    ; diac not sensitive = 32    
  40.  
  41.                                                             ; Registered attribute type constants.    
  42. kNoun                            EQU        -1
  43. kVerb                            EQU        -2
  44. kAdjective                        EQU        -3
  45. kAdverb                            EQU        -4
  46. ;  This Was AttributeType 
  47. ; typedef SInt8                         DictionaryEntryAttribute
  48.  
  49. ;  Dictionary information record 
  50. DictionaryInformation    RECORD 0
  51. dictionaryFSSpec         ds        FSSpec            ; offset: $0 (0)
  52. numberOfRecords             ds.l    1                ; offset: $46 (70)
  53. currentGarbageSize         ds.l    1                ; offset: $4A (74)
  54. script                     ds.w    1                ; offset: $4E (78)
  55. maximumKeyLength         ds.w    1                ; offset: $50 (80)
  56. keyAttributes             ds.b    1                ; offset: $52 (82)
  57.                          ORG 84
  58. sizeof                     EQU *                    ; size:   $54 (84)
  59.                         ENDR
  60. DictionaryAttributeTable RECORD 0
  61. datSize                     ds.b    1                ; offset: $0 (0)
  62. datTable                 ds.b    1                ; offset: $1 (1) <-- really an array of length one
  63. sizeof                     EQU *                    ; size:   $2 (2)
  64.                         ENDR
  65. ; typedef struct DictionaryAttributeTable * DictionaryAttributeTablePtr
  66.  
  67. ;
  68. ; pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
  69. ;
  70.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  71.         Macro
  72.         _InitializeDictionary
  73.             move.w              #$0500,D0
  74.             dc.w                $AA53
  75.         EndM
  76.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  77.         IMPORT_CFM_FUNCTION InitializeDictionary
  78.     ENDIF
  79.  
  80. ;
  81. ; pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
  82. ;
  83.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  84.         Macro
  85.         _OpenDictionary
  86.             move.w              #$0501,D0
  87.             dc.w                $AA53
  88.         EndM
  89.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  90.         IMPORT_CFM_FUNCTION OpenDictionary
  91.     ENDIF
  92.  
  93. ;
  94. ; pascal OSErr CloseDictionary(SInt32 dictionaryReference)
  95. ;
  96.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  97.         Macro
  98.         _CloseDictionary
  99.             move.w              #$0202,D0
  100.             dc.w                $AA53
  101.         EndM
  102.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  103.         IMPORT_CFM_FUNCTION CloseDictionary
  104.     ENDIF
  105.  
  106. ;
  107. ; pascal OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
  108. ;
  109.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  110.         Macro
  111.         _InsertRecordToDictionary
  112.             move.w              #$0703,D0
  113.             dc.w                $AA53
  114.         EndM
  115.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  116.         IMPORT_CFM_FUNCTION InsertRecordToDictionary
  117.     ENDIF
  118.  
  119. ;
  120. ; pascal OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
  121. ;
  122.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  123.         Macro
  124.         _DeleteRecordFromDictionary
  125.             move.w              #$0404,D0
  126.             dc.w                $AA53
  127.         EndM
  128.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  129.         IMPORT_CFM_FUNCTION DeleteRecordFromDictionary
  130.     ENDIF
  131.  
  132. ;
  133. ; pascal OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
  134. ;
  135.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  136.         Macro
  137.         _FindRecordInDictionary
  138.             move.w              #$0805,D0
  139.             dc.w                $AA53
  140.         EndM
  141.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  142.         IMPORT_CFM_FUNCTION FindRecordInDictionary
  143.     ENDIF
  144.  
  145. ;
  146. ; pascal OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
  147. ;
  148.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  149.         Macro
  150.         _FindRecordByIndexInDictionary
  151.             move.w              #$0A06,D0
  152.             dc.w                $AA53
  153.         EndM
  154.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  155.         IMPORT_CFM_FUNCTION FindRecordByIndexInDictionary
  156.     ENDIF
  157.  
  158. ;
  159. ; pascal OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
  160. ;
  161.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  162.         Macro
  163.         _GetDictionaryInformation
  164.             move.w              #$0407,D0
  165.             dc.w                $AA53
  166.         EndM
  167.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  168.         IMPORT_CFM_FUNCTION GetDictionaryInformation
  169.     ENDIF
  170.  
  171. ;
  172. ; pascal OSErr CompactDictionary(SInt32 dictionaryReference)
  173. ;
  174.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  175.         Macro
  176.         _CompactDictionary
  177.             move.w              #$0208,D0
  178.             dc.w                $AA53
  179.         EndM
  180.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  181.         IMPORT_CFM_FUNCTION CompactDictionary
  182.     ENDIF
  183.  
  184.  
  185.  
  186.     ENDIF ; __DICTIONARY__ 
  187.  
  188.